import request from '@/utils/request'

// 获取企业部门列表
export function getDepartmentsAPI() {
  return request({
    url: '/company/department'
  })
}

// 获取部门负责人列表
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}

// 新增部门
export function addDepartmentAPI(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 查看部门详情
export function getDeptsDetailAPI(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 编辑部门
export function updataDeptsAPI(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

// 删除部门
export function delDeptsAPI(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
